/**
 * 
 */
package notifiers;

import models.Appointment;
import models.Comment;
import models.Message;
import play.Play;
import play.mvc.Mailer;

/**
 * @author popoer
 *
 */
public class Mails extends Mailer{
	
	private static Object[] receiver;
	private static String sender;
	
	static{
		receiver = Play.configuration.getProperty("mail.receiver").split(",");
		sender = Play.configuration.getProperty("mail.sender");
	}
	

	public static void sendComment(Comment comment){
		setSubject("来自dentalspark的评论");
		addRecipient(receiver);
		setFrom(sender);
		setCharset("utf-8");
		send(comment);
	}
	
	public static void sendAppointment(Appointment appointment){
		setSubject("来自dentalspark的留言");
		addRecipient(receiver);
		setFrom(sender);
		setCharset("utf-8");
		send(appointment);
	}
	
	public static void sendMessage(Message msg){
		setSubject("来自dentalspark的留言");
		addRecipient(receiver);
		setFrom(sender);
		setCharset("utf-8");
		send(msg);
	}
}
